package com.marvels.approve.task.tasklet;

import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.beans.factory.annotation.Autowired;

import com.marvels.approve.process.service.IProcessService;
import com.marvels.common.utils.MarvelsLogUtil;

/**
 * 定时签约
 */
public class TimingLoanCompactSignTasklet implements Tasklet{

	@Autowired
	private IProcessService processService;
	
	@Override
	public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
		try{
			MarvelsLogUtil.getInstance().info(">>>>>>定时签约开始");
			processService.timingLoanCompactSign();
			MarvelsLogUtil.getInstance().info(">>>>>>定时签约结束");	
		}catch (Throwable e) {
			MarvelsLogUtil.getInstance().error(">>>>>>定时签约异常:",e);
//			throw new Exception("定时生产合同异常",e);
		}
		return RepeatStatus.FINISHED;
	}

}
